<?php
require_once "includes/config.php";
require_once "includes/functions.php";
ini_set('display_errors', 1); 
ini_set('error_reporting', 'E_error'); 
session_start();
ob_start();
$sessid=session_id();
$user = checkSession();
$userId= $user['id'];
$userName= $user['name'];
$userType= $user['type'];
if($_REQUEST['Code']!="")
{
	$sqlSelItemUser="select count(*) as Total from tbl_items_code where code='".$_REQUEST['Code']."'";
	$rstSelItemUser=mysql_query($sqlSelItemUser);
	$rowSelItemUser=mysql_fetch_array($rstSelItemUser);
	if(is_array($rowSelItemUser))
	{
		if((int)$rowSelItemUser['Total']>1)
			echo "This product key is already assigned to any product ".$_REQUEST['Code'];
	}
	//else
//	{
//		echo 0;	
//	}

}
?>